package interface_test;


@java.lang.FunctionalInterface
 interface FunctionalInterface {
    void test();
}
public class LambdaTest{
    public static void main(String[] args) {
       // 匿名内部类
       fun(new FunctionalInterface() {
           @Override
           public void test() {
               System.out.println("匿名内部类实现了 FunctionalInterface接口");
           }
       });
       fun(()->{
           System.out.println("Lambda表达式实现了FunctionalInterface接口");
       });
    }

    private static void fun(FunctionalInterface f1) {
        f1.test();
    }
}
